package com.procidanapps.imisteridiprocida;

import android.content.Context;
import android.media.MediaPlayer;

import com.procidanapps.imisteridiprocida.R;


public class Audio {
	public static final int S1 = R.raw.origovitae;
	private static MediaPlayer mp=null;
	
	/** Play the sound using android.media.MediaPlayer */
	public static void playSound(Context context, int soundID){      
	stop(context);
	mp = MediaPlayer.create(context, soundID); 
	mp.setLooping(true);
	mp.start();
	}
	public static void playSoundSingle(Context context, int soundID){      
	stop(context);
	mp = MediaPlayer.create(context, soundID); 
	mp.setLooping(false);
	mp.start();
	}
	public static void stop (Context context){ 
		if (mp!=null){ 
			mp.stop();
			mp.release();
			mp=null;
		}
	}
	
}
